package com.albon.baseball;


import com.albon.sportsalarm.R;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.LinearLayout;

public class BaseballMain extends Activity implements OnClickListener{

	private LinearLayout mlb_group; //MLB
	private LinearLayout kbo_group; //KBO
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		super.onCreate(savedInstanceState);
		setContentView(R.layout.baseball_main);
	}

	@Override
	protected void onResume() {
		// TODO Auto-generated method stub
		super.onResume();
		init();
	}
	private void init(){
		mlb_group = (LinearLayout)findViewById(R.id.mlb_group);
		kbo_group = (LinearLayout)findViewById(R.id.kbo_group);
		mlb_group.setOnClickListener(this);
		kbo_group.setOnClickListener(this);
	}

	@Override
	public void onClick(View v) {
		// TODO Auto-generated method stub
		switch (v.getId()) {
		case R.id.mlb_group:
			 Intent mlb_group_intent = new Intent(this, BaseballLeague.class);
			 	mlb_group_intent.putExtra("league_name", "mlb");
			 	mlb_group_intent.putExtra("league_title",  getText(R.string.mlb).toString());
			 	mlb_group_intent.putExtra("world",  0);
			  startActivity(mlb_group_intent);
			break;
		case R.id.kbo_group:
			Intent kbo_group_intent = new Intent(this, BaseballLeague.class);
			kbo_group_intent.putExtra("league_name", "kbo");
			kbo_group_intent.putExtra("league_title",  getText(R.string.kbo).toString());
			kbo_group_intent.putExtra("world",  1);
			startActivity(kbo_group_intent);
			break;

		
		}
	}
}
